﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace SortingSpace
{
    class selectionSort : Sorting
    {
        List<int> values;
        public selectionSort(int[] values) { this.values = values.ToList<int>(); }
        
        public void Sort()
        {
            int minElem, len = this.values.Count();
            List<int> res = new List<int>(len);

            for (int i = 0; i < len; i++)
            {
                minElem = this.values.Min();
                res.Add(minElem);
                this.values.Remove(minElem);
            }

            this.values = res;
        }

        public int[] getValues() { return values.ToArray(); }

        public string getName() { return "Simple selection sort"; }
    }
}
